package com.app.mapper;

import com.app.model.UnitsDisasterModel;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

@Mapper
public interface UnitsDisasterMapper extends BaseMapper<UnitsDisasterModel> {

    //统计各单位报灾救援已完成次数
//    @Select("select count(t.id)as 'disasterCount' from lm_units_manager u LEFT join tmp_units_disaster t on t.units_id=u.id  GROUP BY u.id")
    @Select("select count(d.real_name) as 'disasterCount'from lm_units_manager u left join lm_disaster_reporting d on u.name=d.real_name where u.del=0 group by u.name order by u.id")
    List<Integer> getDisasterCount();
}
